/**
 * 继承练习
 */

function inherit(child, parent) {
  Object.setPrototypeOf(child.prototype, parent.prototype);
}

function User(name, psw) {
  this.name = name;
  this.psw = psw;
}

User.prototype.playFree = function () {
  console.log('播放免费视频');
};

function VipUser(name, psw, time) {
  User.call(this, name, psw);
  this.time = time;
}

VipUser.prototype.playVipVideo = function () {
  console.log('播放VIP视频');
};

var vipu = new VipUser('wch', '123', '2025');
vipu.playVipVideo();
